package com.imufe.chemicalenterprisedangerwarning.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.imufe.chemicalenterprisedangerwarning.entity.vo.RoleDetailedVO;
import com.imufe.chemicalenterprisedangerwarning.service.RoleService;
import com.imufe.chemicalenterprisedangerwarning.common.ResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 后台用户角色表 前端控制器
 * </p>
 *
 * @author BaiBan
 * @since 2022-10-11
 */
@Api(tags = "角色")
@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    RoleService service;

    @ApiOperation(value = "角色列表", notes = "角色的列表(分页)")
    @GetMapping("/page")
    public ResponseEntity<IPage<RoleDetailedVO>> page(@RequestParam(value = "current", defaultValue = "1") Long current, @RequestParam(value = "size", defaultValue = "10") Long size) {
        IPage<RoleDetailedVO> page = service.page(current, size);
        return ResponseEntity.success(page);
    }
}